package com.sh.apiclientsdk;

import com.sh.apiclientsdk.client.NameApiClient;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;

@Configuration
// 读取配置文件的属性 给这个类的 ak sk   然后这个类生成对应的 ShApiClient
@ConfigurationProperties("shapi.client")
@Data
@ComponentScan
public class ShApiClientConfig {

    private String accessKey;
    private String secretKey;

    @Bean
    public NameApiClient shApiClient(){
        return new NameApiClient(accessKey,secretKey);
    }


}
